﻿@model List<FTBS.Models.Entities.Theater>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<div style="border:15px">
    <h2>DANH SÁCH RẠP PHIM</h2>

<p>
    @Html.ActionLink("Thêm rạp phim", "Create")
</p>

<table class="table striped bordered hovered" style="margin: 0px 0px 0px 40px">
    <tr>
        <th>Số thứ tự</th>
        <th>Tên rạp phim</th>
        <th>Địa chỉ</th>
        <th>Số điện thoại</th>
        <th colspan="2"></th>
    </tr>
    @foreach (var item in Model)
    {
        <tr>
            <td style="text-align: center">
                @(ViewBag.count = ViewBag.count + 1)
            </td>
            <td>
                @Html.DisplayFor(theaterName => item.TheaterName)
            </td>
            <td>
                @Html.DisplayFor(address => item.Address)
            </td>
            <td>
                @Html.DisplayFor(phoneNumber => item.PhoneNumber)
            </td>
            <td>
                 @Html.ActionLink("Sửa", "Edit", new { id = item.TheaterId })
            </td>
            <td>
                 @using (Html.BeginForm("Delete", "Format", new { id = item.TheaterId }, FormMethod.Post,
                                   new { onsubmit = "return confirm('Bạn có chắc chắn muốn xóa rạp phim này không?');" }))
                {
                    @Html.HttpMethodOverride(HttpVerbs.Delete)
                    <button type="submit" style="background: none; border: none; display: inline; font: inherit; margin: 0; padding: 0; outline: none; outline-offset: 0; /* Additional styles to look like a link */
                                                                                                                                         color: #2e92cf; cursor: pointer;">
                        Xóa</button>
                }
            </td>
        </tr>
    }
</table>
</div>

